package gbootstrap

class BootstrapTagLib {
	static namespace = "bootstrap"
	
	def fixedNavBar = { attrs, body ->
		out << render(template: "/common/components/ui/navigation/fixedNavbar", model: [id: attrs.id, insideBody: body])
	}
	
	def logo = { attrs, body ->
		
		def v_title   = attrs.title ? attrs.title : "${meta(name:'app.name')}"
		def v_version = attrs.version ? attrs.version : " - a${meta(name:'app.version')}"
		 
		out << render(template: "/common/components/ui/logo/brand", model: [id: attrs.id, insideBody: body, title:v_title, version: v_version])
	}


	def searchBox = { attrs, body ->
		out << render(template: "/common/components/ui/searchbox/searchBox", model: [id: attrs.id, cssClasses : attrs.cssClasses])
	}


	def onReady = { attrs, body ->
		out << render(template: "/common/templates/jqueryOnReady", model: [insideBody: body])
	}

	
	
	
	def dropDown = { attrs, body ->
		out << render(template: "/common/components/ui/navigation/dropDown", model: [id: attrs.id, title: attrs.title , insideBody: body])
	}

	def dropDownItem = { attrs, body ->
		
		def v_href = attrs.href ? attrs.href : "#"
		
		out << render(template: "/common/components/ui/navigation/dropDownItem", model: [
			                                                                             id: attrs.id, 
			                                                                             title: attrs.title , 
			                                                                             href: v_href, 
																						 cssClass: attrs.cssClass, 
																						 insideBody: body,
																						 icon : attrs.icon
																						])
	}

	def dropDownSeparator = { attrs, body ->
		out << render(template: "/common/components/ui/navigation/dropDownItem", model: [
																						 title: "" ,
																						 href: "#",
																						 cssClass: "divider",
																						 insideBody: body,
																						 icon: "" 
																						])
	}

}
